package cn.supuwoerc.service.impl;

import cn.supuwoerc.dao.AccountDao;
import cn.supuwoerc.service.AccountService;
import org.springframework.stereotype.Service;

@Service("accountService")
public class AccountServiceImpl implements AccountService {
//    @Autowired
//    @Qualifier("userDao")
    private AccountDao accountDao;

    public void setAccountDao(AccountDao accountDao) {
        this.accountDao = accountDao;
    }

    //转账方法
    public void transfer(String outMan, String inMan, double num) {
        accountDao.sub(outMan,num);
        //int i =  1/0;   //手动制造异常
        accountDao.add(inMan,num);
    }
}
